<template>
  <div>
    <div class="list_items" v-for="item in topList" :key="item.id">
      <div class="sort">{{item.sort}}</div>
      <img :src="item.coverImgUrl" :class="activeTabs === 2 ? 'img_cha' : ''" />
      <div class="search_profiles" :class="activeTabs === 2 ? 'mv_items' : ''">
        <div>
          <div class="song_name">{{ item.name}}</div>
          <div class="Artist_name">{{ item.creator.nickname }}</div>
          <!-- <div class="line"></div> -->
        </div>
        <!-- <span class="iconfont icon-dian"></span> -->
      </div>
    </div>
    <div class="addBtn">
      <button @click="openDialog">Add New Playlist</button>
    </div>
  </div>
</template>

<script setup>
import { computed } from 'vue'
const props = defineProps({
    topList: {
      type: Array,
      default: () => {
        return [];
      },
    },
    activeTabs: {
      type: Number,
    },
  })
const emit = defineEmits(['open'])
const openDialog = ()=>{
  emit('open')
}
</script>

<style lang="less" scoped>
.list_items {
  width: 100%;
  min-height: 58px;
  display: flex;
  // justify-content: space-between;
  margin-bottom: 15px;
  .sort {
    height: 18px;
    font-size: 14px;
    color: #ffffff;
    line-height: 40px;
  }
  img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin-left: 20px;
  }
  .img_cha {
    width: 80px;
    height: 56px;
    flex: 0 0 80px;
  }
  .search_profiles {
    width: 100%;
    font-family: AppleSystemUIFont;
    color: #eeeeee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-left: 16px;
    padding-bottom: 20px;
    position: relative;
    .song_name {
      font-size: 16px;
      margin-bottom: 10px;
      width: 250px;
      overflow:hidden;
      white-space:nowrap;
      text-overflow:ellipsis;
    }
    .Artist_name {
      font-size: 12px;
      color: #817a7a;
    }
    .onlyArtist_name {
      font-size: 16px;
      color: #eeeeee;
    }

    .icon-dian {
      color: #ffffff;
      font-size: 24px;
    }
    .line {
      width: 375px;
      height: 1px;
      background-color: rgba(255, 255, 255, 0.2);
      position: absolute;
      left: 0;
      bottom: 0;
    }
  }
  .mv_items {
    padding-top: 10px;
    padding-bottom: 31px;
  }
}
.addBtn{
  width: 151px;
  height: 40px;
  background: #CBFB5E;
  border-radius: 4px;
  margin: 0 auto;
  margin-top: 48px;
  button{
    width: 100%;
    font-size: 16px;
    font-family: AppleSystemUIFont;
    color: #20242F;
    line-height: 40px;
    margin: 0 auto;

  }
}
</style>
